#ifndef LOCKFREE_STACK_H
#define LOCKFREE_STACK_H

#include <stdatomic.h>
#include <stdbool.h>
#include "../atomic/atomic.h"

typedef struct node {
    void* data;
    struct node* next;
} node_t;

typedef struct {
    atomic_ptr top;
} stack_t;

void stack_init(stack_t* stack);
bool stack_push(stack_t* stack, void* data);
void* stack_pop(stack_t* stack);
bool stack_is_empty(stack_t* stack);

#endif // LOCKFREE_STACK_H 